<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="子程序的调用和返回是一对互逆操作，也是一种特殊的转移操作。 一方面，之所以说是转移，是因为当调用一个子程序时，程序的执行顺序被改变，CPU将转而执行子程序中的指令序列，在这方面，调用子程序的操作含有转移指令的功能，子程序的返回指令的转移特性与此类似； 另一方面，转移指令是一种“一去不复返”的操作，而当子程序完后，还要求CPU能转而执行调用指令之下的指令，它是一种“有去有回”的操作。 为了满足子程序">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="7.2 子程序的调用和返回指令">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2015/04/01/asm29/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="子程序的调用和返回是一对互逆操作，也是一种特殊的转移操作。 一方面，之所以说是转移，是因为当调用一个子程序时，程序的执行顺序被改变，CPU将转而执行子程序中的指令序列，在这方面，调用子程序的操作含有转移指令的功能，子程序的返回指令的转移特性与此类似； 另一方面，转移指令是一种“一去不复返”的操作，而当子程序完后，还要求CPU能转而执行调用指令之下的指令，它是一种“有去有回”的操作。 为了满足子程序">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image003_0018.gif">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image004_0014.gif">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image006_0004.gif">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image007_0009.gif">
<meta property="og:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image008_0003.gif">
<meta property="og:updated_time" content="2019-01-21T13:59:48.420Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="7.2 子程序的调用和返回指令">
<meta name="twitter:description" content="子程序的调用和返回是一对互逆操作，也是一种特殊的转移操作。 一方面，之所以说是转移，是因为当调用一个子程序时，程序的执行顺序被改变，CPU将转而执行子程序中的指令序列，在这方面，调用子程序的操作含有转移指令的功能，子程序的返回指令的转移特性与此类似； 另一方面，转移指令是一种“一去不复返”的操作，而当子程序完后，还要求CPU能转而执行调用指令之下的指令，它是一种“有去有回”的操作。 为了满足子程序">
<meta name="twitter:image" content="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image003_0018.gif">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2015/04/01/asm29/">





  <title>7.2 子程序的调用和返回指令 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2015/04/01/asm29/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">7.2 子程序的调用和返回指令</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2015-04-01T20:35:54+08:00">
                2015-04-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/汇编教程/" itemprop="url" rel="index">
                    <span itemprop="name">汇编教程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>子程序的调用和返回是一对互逆操作，也是一种特殊的转移操作。</p>
<p>一方面，之所以说是转移，是因为当调用一个子程序时，程序的执行顺序被改变，CPU将转而执行子程序中的指令序列，在这方面，调用子程序的操作含有转移指令的功能，子程序的返回指令的转移特性与此类似；</p>
<p>另一方面，转移指令是一种“一去不复返”的操作，而当子程序完后，还要求CPU能转而执行调用指令之下的指令，它是一种“有去有回”的操作。</p>
<p>为了满足子程序调用和返回操作的特殊性，在指令系统中设置了相应的特定指令。</p>
<hr>
<h2 id="7-2-1-调用指令-CALL"><a href="#7-2-1-调用指令-CALL" class="headerlink" title="7.2.1 调用指令(CALL)"></a>7.2.1 调用指令(CALL)</h2><p>调用子程序指令的格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CALL　子程序名/Reg/Mem</span><br></pre></td></tr></table></figure>
<p>子程序的调用指令分为近(near)调用和远(far)调用。如果被调用子程序的属性是近的，那么，CALL指令将产生一个近调用，它把该指令之后地址的偏移量(用一个字来表示的)压栈，把被调用子程序入口地址的偏移量送给指令指针寄存器IP即可实现执行程序的转移。近调用指令的堆栈操作如图7.1所示。</p>
<p><img src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image003_0018.gif" alt></p>
<center><strong>图7.1 近调用指令进栈操作示意图</strong></center>

<p>如果被调用子程序的属性是远的，那么，CALL指令将产生一个远调用。这时，调用指令不仅要把该指令之后地址的偏移量压进栈，而且也要把段寄存器CS的值压进栈。在此之后，再把被调用子程序入口地址的偏移量和段值分别送给IP和CS，这样完成了子程序的远调用操作。远调用指令的堆栈操作如图7.2所示。</p>
<p><img src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image004_0014.gif" alt></p>
<center><strong>图7.2 远调用指令进栈操作示意图</strong></center>

<p>子程序调用指令本身的执行不影响任何标志位，但子程序体中指令的执行会改变标志位，所以，如果希望子程序的执行不能改变调用指令前后的标志位，那么，就要在子程序的开始处保护标志位，在子程序的返回前恢复标志位。</p>
<p>例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">CALL  DISPLAY ;DISPLAY是子程序名</span><br><span class="line"></span><br><span class="line">CALL  BX ;BX的内容是子程序的偏移量</span><br><span class="line"></span><br><span class="line">CALL  WORD1 ;WORD1是内存字变量，其值是子程序的偏移量</span><br><span class="line"></span><br><span class="line">CALL  DWORD1 ;DWORD1是双字变量，其值是子程序的偏移量和段值</span><br><span class="line"></span><br><span class="line">CALL  word ptr [BX] ;BX所指内存字单元的值是子程序的偏移量</span><br><span class="line"></span><br><span class="line">CALL  dword ptr [BX] ;BX所指内存双字单元的值是子程序的偏移量和段值</span><br></pre></td></tr></table></figure>
<h2 id="7-2-2-返回指令-RET"><a href="#7-2-2-返回指令-RET" class="headerlink" title="7.2.2 返回指令(RET)"></a>7.2.2 返回指令(RET)</h2><p>当子程序执行完时，需要返回到调用它的程序之中。为实现此功能，指令系统提供了一条专用的返回指令。其格式如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">RET/RETN/RETF [Imm]</span><br></pre></td></tr></table></figure>
<p>子程序的返回在功能上是子程序调用的逆操作。为了与子程序的远、近调用相对应，子程序的返回也分：远返回和近返回。返回指令在堆栈操作方面是调用指令的逆过程(如图7.3所示)。其具体规定如下：</p>
<ul>
<li>在近类型的子程序中，返回指令RET是近返回，其功能是把栈顶之值弹出到指令指针寄存器IP中，SP会被加2(如图7.3所示)；</li>
<li>在远类型的子程序中，返回指令RET是远返回，其功能是：先弹出栈顶之值到IP中，再弹出栈顶之值到CS之中，SP总共会被加4(如图7.4所示)。</li>
</ul>
<p><img src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image006_0004.gif" alt></p>
<center><strong>图7.3 近返回指令的出栈操作示意图</strong></center>

<p><img src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image007_0009.gif" alt></p>
<center><strong>图7.4 远返回指令的出栈操作示意图</strong></center>

<p>如果返回指令后面带有立即数(其值通常为偶数)，则表示在得到返回地址之后，SP还要增加的偏移量，它不是类似于高级语言中子程序的返回值(如图7.5所示)。</p>
<p><img src="http://www.iteedu.com/plang/asm/asmhbyychxshj/images/clip_image008_0003.gif" alt></p>
<center><strong>图7.5 带立即数的返回指令的出栈操作示意图</strong></center>


<p>在MASM 5.0及其以后版本中，可用指令RETN或RETF来显式地告诉汇编程序是本子程序的返回是近返回，还是远返回。</p>
<p>例如：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">RET ;可能是近返回，也可能是远返回</span><br><span class="line"></span><br><span class="line">RETN ;近返回指令</span><br><span class="line"></span><br><span class="line">RETF ;远返回指令</span><br><span class="line"></span><br><span class="line">RET　6 ;子程序返回后，(SP)←(SP) + 6</span><br></pre></td></tr></table></figure>
<p><strong>例7.1 编写一个子程序UPPER，实现把寄存器AL中存放的字符变大写。</strong></p>
<p>解：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">;子程序功能：把AL中存放的字符变大写 </span><br><span class="line"></span><br><span class="line">;入口参数：AL</span><br><span class="line"></span><br><span class="line">;出口参数：AL</span><br><span class="line"></span><br><span class="line">;算法描述：判断AL中字符必须在&apos;a&apos;~&apos;z&apos;之间才能把该字符变为大写 </span><br><span class="line"></span><br><span class="line">UPPER PROC</span><br><span class="line"></span><br><span class="line">CMP AL, &apos;a&apos; ;书写&apos;a&apos;的ASCII码61H也可以 </span><br><span class="line"></span><br><span class="line">JB over</span><br><span class="line"></span><br><span class="line">CMP AL, &apos;z&apos;</span><br><span class="line"></span><br><span class="line">JA over</span><br><span class="line"></span><br><span class="line">SUB  AL, 20H ;书写指令AND AL, 0DFH也可以</span><br><span class="line"></span><br><span class="line">over: RET</span><br><span class="line"></span><br><span class="line">UPPER ENDP</span><br></pre></td></tr></table></figure>
<p><strong>例7.2 编写一个求字符串长度的子程序StrLen，该字符串以0为结束标志，其首地址存放在DS:DX，其长度保存在CX中返回。</strong></p>
<p>解：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">;子程序功能：求字符串的长度 </span><br><span class="line"></span><br><span class="line">;入口参数：DS:DX存放字符串的首地址，该字符串以0为结束标志 </span><br><span class="line"></span><br><span class="line">;出口参数：CX存放该字符串的长度 </span><br><span class="line"></span><br><span class="line">;算法描述：用BX来指针来扫描字符串中的字符，如果遇到其结束标志，则停止扫描字符串操作 </span><br><span class="line"></span><br><span class="line">StrLen PROC</span><br><span class="line"></span><br><span class="line">PUSH AX</span><br><span class="line"></span><br><span class="line">PUSH BX ;用堆栈来保存子程序所用到的寄存器内容 </span><br><span class="line"></span><br><span class="line">XOR CX, CX</span><br><span class="line"></span><br><span class="line">XOR AL, AL</span><br><span class="line"></span><br><span class="line">MOV  BX, DX</span><br><span class="line"></span><br><span class="line">again: CMP [BX], AL</span><br><span class="line"></span><br><span class="line">JZ  over</span><br><span class="line"></span><br><span class="line">INC CX ;增加字符串的长度 </span><br><span class="line"></span><br><span class="line">INC BX ;访问字符串的指针向后移 </span><br><span class="line"></span><br><span class="line">JMP again</span><br><span class="line"></span><br><span class="line">over: POP BX ;恢复在子程序开始时所保存的寄存器内容 </span><br><span class="line"></span><br><span class="line">POP AX</span><br><span class="line"></span><br><span class="line">RET</span><br><span class="line"></span><br><span class="line">StrLen ENDP</span><br></pre></td></tr></table></figure>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2015/04/01/asm28/" rel="next" title="7.1 子程序的定义">
                <i class="fa fa-chevron-left"></i> 7.1 子程序的定义
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2015/04/01/asm30/" rel="prev" title="7.3 子程序的参数传递">
                7.3 子程序的参数传递 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#7-2-1-调用指令-CALL"><span class="nav-number">1.</span> <span class="nav-text">7.2.1 调用指令(CALL)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-2-2-返回指令-RET"><span class="nav-number">2.</span> <span class="nav-text">7.2.2 返回指令(RET)</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
